<?php slot('header')?>

<style type="text/css">
<!-- 
div.box-content-main table.table-list td.number{
	width: 100px;
}
-->
</style>
<?php end_slot()?>
<div class="box-navigation">
	<?php echo $data['navigation']?>
</div>
<div class="clr"></div>
<?php include_component('default', 'error');?>
<div class="clr"></div>
<div class="box-filter">
	<form action="<?php echo $data['filter_action']?>" method="get" name="filter_form" id="filter-form">
		<select name="filter[filter_enabled]" id="filter-enable" class="combo-box hz-selected" data-selected="<?php echo $data['filter']['filter_enabled']?>">
			<option value="-1"><?php echo __('select-option-all')?></option>
			<option value="0"><?php echo __('is-enabled-0')?></option>
			<option value="1"><?php echo __('is-enabled-1')?></option>
		</select>
		<input type="text" class="hz-data-sample" maxlength="255" name="filter[filter_key]" id="filter-key" value="<?php echo $data['filter']['filter_key']?>" data-sample="<?php echo __('filter-sample')?>"/>
		<input type="button" name="filter[filter_submit]" id="filter_submit" class="button hz-filter-submit" data-form-id="filter-form" data-keysearch-id="filter-key" value="<?php echo __('filter-submit')?>"/>
	</form>
</div>
<div class="clr"></div>
<div class="box-content">
	<form action="<?php echo $data['filter_action']?>" method="post" name="form_main" id="form-main">
		<input type="hidden" value="none" name="action_name" id="action-name"/>
		<div class="control">
			<a href="#" class="hz-control-get add" data-action="<?php echo ADMIN_DEFINED::ADD_RECORD?>" ><?php echo __('control-add')?></a>
			<a href="#" class="hz-control delete" data-action="<?php echo ADMIN_DEFINED::DELETE_RECORD?>" hz-require="selected" hz-confirm="confirm" data-confirm="<?php echo __('confirm-delete')?>"><?php echo __('control-delete')?></a>
			<a href="#" class="hz-control enable" data-action="<?php echo ADMIN_DEFINED::ENABLE?>" hz-require="selected"><?php echo __('control-enable')?></a>
			<a href="#" class="hz-control disable" data-action="<?php echo ADMIN_DEFINED::DISABLE?>" hz-require="selected"><?php echo __('control-disable')?></a>
			<a href="#" class="hz-control save-order" data-action="<?php echo ADMIN_DEFINED::SAVE_ORDER?>" ><?php echo __('control-save-order')?></a>
		</div>
		<div class="clr"></div>
		<div class="box-content-main">
			<table class="table-list" cellspacing="0" cellpadding="0" border="0">
				<tr>
					<td class="head checkbox-select"><input type="checkbox" name="select_checkall" id="select-checkall" title="<?php echo __('to-checkall')?>" class="chk-select chk-checkall"/></td>
					<td class="head title"><?php echo __('location-areas-name')?></td>
					<td class="head number"><?php echo __('location-provinces-number')?></td>
					<td class="head sort-order"><?php echo __('sort-order')?></td>
					<td class="head updated-at"><?php echo __('updated-at')?></td>
					<td class="head action"><?php echo __('list-action')?></td>
				</tr>
				<?php 
				$count_for = 0;
				foreach($data['list'] as $val):
					$number = 1;// Galleries::getDataListCount(array('filter_gallery_album_id' => $val['id']));
				?>
				<tr class="class<?php echo ++$count_for%2?> enable-<?php echo intval($val['is_enabled'])?>">
					<td class="checkbox-select"><input type="checkbox" name="select_list[]" class="checkbox-select" value="<?php echo $val['id']?>" id="select_<?php echo $val['id']?>" title="<?php echo __('to-check')?>" /></td>
					<td class="title">
						<a href="#" class="hz-control-get edit" data-action="<?php echo ADMIN_DEFINED::EDIT_RECORD?>&id=<?php echo $val['id']?>" data-require="none">
							<?php echo $val['name']?>
						</a>	
					</td>
					<td class="img">
							<?php echo $number?>
						
					</td>
					<td class="sort-order">
						<input type="text" data-require="number-only" name="sort_orders[]" class="sort-order" value="<?php echo $val['sort_order']?>"/>
						<input type="hidden" name="ids[]" value="<?php echo $val['id']?>"/>
					</td>
					
					<td class="updated-at"><?php echo DateHelper::dateFormat($val['updated_at'])?></td>
					<td class="action">
						<a href="#" class="hz-control-get edit"  data-action="<?php echo ADMIN_DEFINED::EDIT_RECORD ?>&id=<?php echo $val['id']?>" title="<?php echo __('action-edit')?>" alt="<?php echo __('action-edit')?>" class="column-action"><img src="/css/admin/img/global/edit.png"/></a>
					</td>
				</tr>
				<?php endforeach;?>
			</table>
		</div>
		<div class="clr"></div>
		<div class="control">
			<a href="#" class="hz-control-get add" data-action="<?php echo ADMIN_DEFINED::ADD_RECORD?>" ><?php echo __('control-add')?></a>
			<a href="#" class="hz-control delete" data-action="<?php echo ADMIN_DEFINED::DELETE_RECORD?>" hz-require="selected" hz-confirm="confirm" data-confirm="<?php echo __('confirm-delete')?>"><?php echo __('control-delete')?></a>
			<a href="#" class="hz-control enable" data-action="<?php echo ADMIN_DEFINED::ENABLE?>" hz-require="selected"><?php echo __('control-enable')?></a>
			<a href="#" class="hz-control disable" data-action="<?php echo ADMIN_DEFINED::DISABLE?>" hz-require="selected"><?php echo __('control-disable')?></a>
			<a href="#" class="hz-control save-order" data-action="<?php echo ADMIN_DEFINED::SAVE_ORDER?>" ><?php echo __('control-save-order')?></a>
		</div>
		<?php if(count($data['pagination_pager'])>1):?>
		<div class="pagination">
			<span><?php echo __('pagination-text')?></span>
			<span class="pagination"> 
			<?php foreach ($data['pagination_pager'] as $p):?>
				<a href="<?php echo empty($p['url'])?'#':($data['app_prefix'].$p['url'])?>" class="<?php echo $p['page_class']?>"><?php echo $p['page_num']?></a>
			<?php endforeach;?>
			</span>
			<div class="clr"></div>
		</div>
		<?php endif;?>
		<div class="clr"></div>
	</form>
</div>